/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * DLChart.java
 *
 * Created on Aug 30, 2010, 6:04:11 PM
 */

package Gui;

import BusinessLogic.BackGroundUtility;
import BusinessLogic.DrawChart;
import java.awt.Dimension;
import java.awt.Toolkit;

/**
 *
 * @author SONY
 */
public class DLChart extends javax.swing.JDialog {

    /** Creates new form DLChart */
    public DLChart(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
        //set background
        ImagePanel iPanel = new ImagePanel(BackGroundUtility.getImage());
        getContentPane().add(iPanel);
        //setlocation for application
        Toolkit toolkit = Toolkit.getDefaultToolkit();
        Dimension dim = toolkit.getScreenSize();
        Dimension dimApp = getSize();
        int pointX = (dim.width - dimApp.width)/2;
        int pointY = (dim.height - dimApp.height)/2 - 10;
        setLocation(pointX, pointY);
        
        DrawChart c = new DrawChart();

        pnContent.add(c);
        c.setBounds(2, 2, pnContent.getWidth() - 4, pnContent.getHeight() - 4);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        pnBackground = new javax.swing.JPanel();
        pnConta = new javax.swing.JPanel();
        pnContent = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Chart and Graph");
        setResizable(false);

        pnBackground.setOpaque(false);

        pnConta.setBackground(new java.awt.Color(255, 255, 255));

        pnContent.setLayout(null);

        jLabel1.setText("<html>\nChart use to reports of booth assignments and analyzing your booth data by day.\n</html>");

        javax.swing.GroupLayout pnContaLayout = new javax.swing.GroupLayout(pnConta);
        pnConta.setLayout(pnContaLayout);
        pnContaLayout.setHorizontalGroup(
            pnContaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnContaLayout.createSequentialGroup()
                .addContainerGap(29, Short.MAX_VALUE)
                .addGroup(pnContaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 406, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(pnContent, javax.swing.GroupLayout.PREFERRED_SIZE, 717, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(24, 24, 24))
        );
        pnContaLayout.setVerticalGroup(
            pnContaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnContaLayout.createSequentialGroup()
                .addGap(24, 24, 24)
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 28, Short.MAX_VALUE)
                .addComponent(pnContent, javax.swing.GroupLayout.PREFERRED_SIZE, 337, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(26, 26, 26))
        );

        javax.swing.GroupLayout pnBackgroundLayout = new javax.swing.GroupLayout(pnBackground);
        pnBackground.setLayout(pnBackgroundLayout);
        pnBackgroundLayout.setHorizontalGroup(
            pnBackgroundLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnBackgroundLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(pnConta, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        pnBackgroundLayout.setVerticalGroup(
            pnBackgroundLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnBackgroundLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(pnConta, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        getContentPane().add(pnBackground, java.awt.BorderLayout.CENTER);

        pack();
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    private javax.swing.JPanel pnBackground;
    private javax.swing.JPanel pnConta;
    private javax.swing.JPanel pnContent;
    // End of variables declaration//GEN-END:variables

}
